﻿/* 
 * Produzido por:
 *      Daniel Vargas
 *      Danilo Valvezon
 *      Fernanda Osaki
 *      Tiago Ricardo Almeida da Silva
 *      
 * FATEC São Caetano do Sul
 * Jogos NA6
 * */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace bomberboyonline
{
    // Classe que representa parede no jogo
    class Parede : Microsoft.Xna.Framework.DrawableGameComponent
    {
        // Declaracao de variaveis
        private Texture2D textura;
        private int posicao;

        // Construtor da classe
        public Parede(Game game, int posicao)
            : base(game)
        {
            // Atribuicao de valor a variaveis
            textura = game.Content.Load<Texture2D>("arquivos\\parede");
            this.posicao = posicao;
        }

        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        public override void Initialize()
        {
            base.Initialize();
        }

        /// <summary>
        /// Allows the game component to update itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        /// <summary>
        /// Allows the game component to draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Draw(GameTime gameTime)
        {
            // Pega o Spritebatch do Services
            SpriteBatch sBatch = (SpriteBatch)Game.Services.GetService(typeof(SpriteBatch));
            // Desenha o fundo
            sBatch.Draw(textura, new Rectangle(Coordenadas.retangulos[posicao].X, Coordenadas.retangulos[posicao].Y, Coordenadas.W, Coordenadas.H), Color.White);

            base.Draw(gameTime);
        }
        

        // get da posicao
        public int getPosicao()
        {
            return posicao;
        }

    }
}
